package {{packageName}}.core.{{clientEntity.entity.module}}.client;

import java.io.Serializable;
import java.util.*;
{{#if entity.hasBigDecimal}}
import java.math.BigDecimal;
{{/if}}
import lombok.extern.slf4j.Slf4j;

import cn.ibizlab.util.security.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.util.Assert;
import org.springframework.beans.factory.annotation.Value;
import cn.ibizlab.util.errors.BadRequestAlertException;
import cn.ibizlab.util.enums.CheckKeyStatus;
{{#system.enableGlobalTransaction}}
import io.seata.spring.annotation.GlobalTransactional;
{{/system.enableGlobalTransaction}}
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import {{packageName}}.core.{{clientEntity.entity.module}}.domain.{{clientEntity.entity.domainClassName}};
import {{packageName}}.core.{{clientEntity.entity.module}}.filter.{{clientEntity.entity.codeName}}SearchContext;
import {{packageName}}.core.{{clientEntity.entity.module}}.service.{{clientEntity.entity.codeName}}Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author generator
 */
@FeignClient(value = "${ibiz.ref.service.{{lowerCase clientEntity.client.codeName}}:{{lowerCase clientEntity.client.service}}{{raw "}" }}", contextId = "{{lowerCase clientEntity.codeName}}")
public interface {{clientEntity.codeName}}FeignClient  {
{{#each clientEntity.methods}}
    {{#neq name "Select"}}
    @{{pascalCase requestMethod}}Mapping("{{requestPath2}}")
    {{#if (or (eq codeName "CheckKey")(eq codeName "check_key"))}}CheckKeyStatus{{else}}{{outParam}}{{/if}} {{camelCase codeName}}{{#each pathVariables}}{{#if @first}}By{{else}}And{{/if}}{{pascalCase name}}{{/each}}({{#each pathVariables}}{{#unless @first}}, {{/unless}}@PathVariable("{{camelCase name}}") {{type.java}} {{camelCase name}}{{/each}}{{#if body}}{{#if pathVariables}}, {{/if}}{{#neq requestMethod 'GET'}}@Validated @RequestBody {{else}}@SpringQueryMap {{/neq}}{{body}}{{/if}}) ;

    {{/neq}}
{{/each}}
    @PostMapping("{{pluralize clientEntity.codeName}}/batch")
    Boolean createBatch(@RequestBody List<{{clientEntity.entity.domainClassName}}> domains);

    @PutMapping("{{pluralize clientEntity.codeName}}/batch")
    boolean updateBatch(@RequestBody List<{{clientEntity.entity.domainClassName}}> domains);

    @PostMapping("{{pluralize clientEntity.codeName}}/savebatch")
    boolean saveBatch(@RequestBody List<{{clientEntity.entity.domainClassName}}> domains);

    @PostMapping("{{pluralize clientEntity.codeName}}/import")
    Map importData(@RequestParam(value = "config") String config ,@RequestBody List<{{clientEntity.entity.domainClassName}}> domains);

    @DeleteMapping("{{pluralize clientEntity.codeName}}")
    boolean removeBatch(@RequestBody List<{{clientEntity.entity.keyField.type.java}}> ids);

}